﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BaoJian.Control.local
{
    public partial class SummaryDocList : System.Web.UI.UserControl
    {
        public string ColumnID;
        public bool ShowImage = false;
        public int SummaryLength;
        public string Region;

        public string Summary;
        public string OID;
        public string DocTitle;


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string sql = "SELECT TOP 1 sid,oid,pid,title,summary,ctime,FirstSmallImage  FROM doc WHERE Region='{0}'AND PID='{1}' AND Recommand=1 and publish=1 ORDER BY CTime DESC";
                sql = string.Format(sql, Region, ColumnID);
                DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    OID = ds.Tables[0].Rows[0]["oid"] as string;
                    DocTitle = ds.Tables[0].Rows[0]["title"] as string;
                    Summary = ds.Tables[0].Rows[0]["summary"] as string;
                }
            }
        }
    }
}